home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / g_man / cat3 / OpenGL-ftn / fgluproject.z / fgluproject
Encoding:
Text File  |  2002-10-03  |  4.0 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))                OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt - map object coordinates to window coordinates
  10.  
  11.  
  12. FFFFOOOORRRRTTTTRRRRAAAANNNN SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
  13.      INTEGER*4 ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt( REAL*4 _o_b_j_X,
  14.                             REAL*4 _o_b_j_Y,
  15.                             REAL*4 _o_b_j_Z,
  16.                             CHARACTER*8 _m_o_d_e_l,
  17.                             CHARACTER*8 _p_r_o_j,
  18.                             CHARACTER*8 _v_i_e_w,
  19.                             CHARACTER*8 _w_i_n_X,
  20.                             CHARACTER*8 _w_i_n_Y,
  21.                             CHARACTER*8 _w_i_n_Z )
  22.  
  23.  
  24. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
  25.      _o_b_j_X, _o_b_j_Y, _o_b_j_Z
  26.                      Specify the object coordinates.
  27.  
  28.      _m_o_d_e_l           Specifies the current modelview matrix (as from a
  29.                      ggggllllGGGGeeeettttDDDDoooouuuubbbblllleeeevvvv call).
  30.  
  31.      _p_r_o_j            Specifies the current projection matrix (as from a
  32.                      ggggllllGGGGeeeettttDDDDoooouuuubbbblllleeeevvvv call).
  33.  
  34.      _v_i_e_w            Specifies the current viewport (as from a ggggllllGGGGeeeettttIIIInnnntttteeeeggggeeeerrrrvvvv
  35.                      call).
  36.  
  37.      _w_i_n_X, _w_i_n_Y, _w_i_n_Z
  38.                      Return the computed window coordinates.
  39.  
  40. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  41.      ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt transforms the specified object coordinates into window
  42.      coordinates using _m_o_d_e_l, _p_r_o_j, and _v_i_e_w. The result is stored in _w_i_n_X,
  43.      _w_i_n_Y, and _w_i_n_Z. A return value of GGGGLLLL____TTTTRRRRUUUUEEEE indicates success, a return
  44.      value of GGGGLLLL____FFFFAAAALLLLSSSSEEEE indicates failure.
  45.  
  46.      To compute the coordinates, let v = (objX,objY,objZ,1.0) represented as a
  47.      matrix with 4 rows and 1 column.  Then ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt computes v' as
  48.      follows:
  49.  
  50.      v' = P x M x v
  51.  
  52.      where P is the current projection matrix _p_r_o_j, M is the current modelview
  53.      matrix _m_o_d_e_l (both represented as 4x4 matrices in column-major order) and
  54.      'x' represents matrix multiplication.
  55.  
  56.      The window coordinates are then computed as follows:
  57.  
  58.      winX = view(0) + view(2) * (v'(0) + 1) / 2
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))                OOOOppppeeeennnnGGGGLLLL RRRReeeeffffeeeerrrreeeennnncccceeee                ffffgggglllluuuuPPPPrrrroooojjjjeeeecccctttt((((3333GGGG))))
  71.  
  72.  
  73.  
  74.      winY = view(1) + view(3) * (v'(1) + 1) / 2
  75.  
  76.      winZ = (v'(2) + 1) / 2
  77.  
  78.  
  79. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  80.      ggggllllGGGGeeeetttt, ffffgggglllluuuuUUUUnnnnPPPPrrrroooojjjjeeeecccctttt
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.